package com.bluesky.plum.domain.repository.search.operator;

import java.util.Set;

public enum CollectionOperator implements LogicOperator{
	In {
		@Override
		Boolean localOperate(Object o1, Set O2){
			
			return O2.contains(o1); 
		}
	},NotIn{
		@Override
		Boolean localOperate(Object o1, Set O2){
			
			return !O2.contains(o1); 
		}
	};
	
	abstract Boolean localOperate(Object o1, Set O2);
	
	public Boolean operate(Object o1,Object o2){
		return localOperate((Object)o1,(Set)o2);
	}
}
